﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace LDAP.Entity
{
    public class User
    {
        public string Id { get; set; }
        public string UserName { get; set; }
        public string Email { get; set; }
        public string DeptName { get; set; }
        public UserStatus Status { get; set; }

        public string name {
            get { return this.UserName + "(" + this.Id + ")"; }
        }

        public string py
        {
            get { return this.Email.Substring(0, this.Email.IndexOf('@')); }
        }

        public User() { }

        public User(User user)
        {
            Id = user.Id;
            UserName = user.UserName;
            Email = user.Email;
            DeptName = user.DeptName;
            Status = user.Status;
        }
    }

    public enum UserStatus
    {
        /// <summary>
        /// 在职
        /// </summary>
        Work = 0,
        /// <summary>
        /// 离职
        /// </summary>
        Leave = 1,
        /// <summary>
        /// 兼职
        /// </summary>
        PartTime = 2,
        /// <summary>
        /// 实习
        /// </summary>
        Study = 3
    }
}